@extends('layouts.home')
@section('title')
  管理记忆项目
@stop
@section('content')
<div class="content">
<table class="table table-hover">
<tr>
<td>ID：</td>
<td>名字：</td>
<td>内容：</td>
<td>类别：</td>
<td>性质：</td>
<td>创立时间：</td>
<td>回忆时间：</td>
<td>修改：</td>
</tr>

  @foreach ($memories as $memories)
<tr>
  <td>{{$memories->id}}</td>
  <td>{{$memories->name}}</td>
  <td>{{$memories->content}}</td>
  <td>{{$memories->family}}</td>
  <td>{{$memories->type}}</td>
  <td>{{$memories->created_at}}</td>
  <td>{{$memories->recall_time}}</td>
  <td><form action="{{route('memories.destroy',$memories->id)}}" method="POST">
    {{ csrf_field() }}
    {{ method_field('DELETE')}}
    <button class="btn btn-default" type="submit">删除</button>
  </form>
  </td>
</tr>
  @endforeach
</table>
<div class="panel-body">
  @include('shared.errors')
  @include('shared.messages')
  <form method="POST" action="/memories">
    {{ csrf_field() }}

      <div class="form-group">
        <label for="name">名称：</label>
        <input type="text" name="name" class="form-control" value="{{ old('name') }}">
      </div>

      <div class="form-group">
        <label for="content">内容：</label>
        <input type="text" name="content" class="form-control" value="{{ old('content') }}">
      </div>

      <div class="form-group">
        <label for="family">类别：</label>
        <input type="text" name="family" class="form-control" value="{{ old('family') }}">
      </div>

      <div class="form-group">
        <label for="type">性质：</label>
        <input type="text" name="type" class="form-control" value="{{ old('type') }}">
      </div>

      <button type="submit" class="btn btn-primary">创建记忆项目</button>
  </form>
</div>

<table class="table table-hover">
<tr>
<td>ID：</td>
<td>名字：</td>
<td>内容：</td>
<td>类别：</td>
<td>性质：</td>
<td>完成时间：</td>
</tr>

  @foreach ($memories_f as $memories)
<tr>
  <td>{{$memories->id}}</td>
  <td>{{$memories->name}}</td>
  <td>{{$memories->content}}</td>
  <td>{{$memories->family}}</td>
  <td>{{$memories->type}}</td>
  <td>{{$memories->deleted_at}}</td>
</tr>
  @endforeach
</table>

</div>
@endsection
